<?php use_stylesheet('../sfDoctrinePlugin/css/default.css') ?>
<div id="sf_admin_container">
    <h1><?php echo isset($solution) ? $solution->getTitle() . ' p' : 'P' ?>ortfolios list</h1>
    <?php if ($portfolios->getFirst()): ?>
        <table>
            <thead>
                <tr>
                    <th>Id</th>
                    <th>User profile</th>
                    <th>Title</th>
                    <th>About</th>
                    <th>Slug</th>
                    <th>Created at</th>
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($portfolios as $portfolio): ?>
                    <tr>
                        <td><?php echo $portfolio->getId() ?></td>
                        <td><?php echo $portfolio->getUserProfileId() ?></td>
                        <td><?php echo $portfolio->getTitle() ?></td>
                        <td><?php echo $portfolio->getAbout() ?></td>
                        <td><?php echo $portfolio->getSlug() ?></td>
                        <td><?php echo $portfolio->getCreatedAt() ?></td>
                        <td> 
                            <ul class="sf_admin_td_actions">
                                <li class="sf_admin_action_edit"><a href="<?php echo url_for('portfolio/edit?id=' . $portfolio->getId()) ?>">Edit</a></li>    
                                <li class="sf_admin_action_delete"><?php echo link_to('Delete', 'portfolio/delete?id=' . $portfolio->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?></li>  </ul>
                        </td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    <?php endif; ?>
    <?php if (isset($solution_id)): ?>
        <ul class="sf_admin_actions">
            <li class="sf_admin_action_new">
                <a href="<?php echo url_for(array('module' => 'portfolio', 'action' => 'new', 'solution_id' => $solution_id)) ?>">Create new</a>
            </li></ul>
    <?php endif; ?>
</div>
